package com.sky.mapper.admin;


import com.github.pagehelper.Page;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.pojo.Employee;
import org.apache.ibatis.annotations.*;



public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);


    /**
     * 新增员工
     * @param employee
     */
    void insert(Employee employee);


    /**
     * 员工分页查询
     * @param employeePageQueryDTO
     * @return
     */
    Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);


    /**
     * 启用禁用员工
     * @param status
     * @param id
     */
    @Update("update employee set status=#{status} where id=#{id}")
    void startOrStop(Integer status, Long id);

    /**
     * 根据id查询员工
     * @param id
     * @return
     */
    @Select("select * from  employee where id=#{id}")
    Employee getById(Long id);

    /***
     * 修改员工
     * @param employee
     */
    void update(Employee employee);
}
